package io2_homework;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name = "李四";
        int age  = 20;
        String gender = "男";
        String[]otherInfo = {"是一名练习生","喜欢打篮球","练习时长两年半"};
        Student ls = new Student(name,age,gender,otherInfo);
        System.out.println(ls);

        FileOutputStream fos = new FileOutputStream("student1.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(ls);
        System.out.println("写出完成!");
        oos.close();

    }
}
